﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;

namespace HelfenHelfen.Web.MVC.Helpers
{
    public static class ImageHelper
    {
        public static byte[] GetImageFromFile(HttpPostedFileBase httpPostedFile)
        {
            using (Stream imgStream = httpPostedFile.InputStream)
            {
                int imgLen = httpPostedFile.ContentLength;
                string imgContentType = httpPostedFile.ContentType;
                byte[] imgBinaryData = new byte[imgLen];
                int n = imgStream.Read(imgBinaryData, 0, imgLen);

                return imgBinaryData;
            }

        }
    }
}